package com.iterator.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

//信息工程学院
public class InfoCollege implements College{

    private List<Department> departments = new ArrayList<>();

    public InfoCollege() {
        departments.add(new Department("通信" , "通信"));
        departments.add(new Department("网络" , "网络"));
    }

    @Override
    public String getName() {
        return "信息工程学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        departments.add(new Department(name , desc));
    }

    @Override
    public Iterator getIterator() {
        return new InfoCollegeIterator(departments);
    }
}
